class Benz:
    pass


class BMW:
    pass


class BYD:
    pass


class CarFactory:
    __cars = {"benz": Benz, "bmw": BMW, "byd": BYD}

    @classmethod
    def get_car(cls, brand):
        c = cls.__cars.get(brand, BYD)
        return c()


for b in ("benz", "bmw", "byd", "foobar"):
    c = CarFactory.get_car(b)
    print(c)
